<template>
  <el-row class="tac">
    <el-col :span="24">
      <h5 class="mb-2">Soccer-Master后台管理系统</h5>
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo custom-menu"
        @open="handleOpen"
        @close="handleClose"
      >

      <RouterLink to ="/administrator/main1">
        <el-menu-item index="0">
          <el-icon><icon-menu /></el-icon>
          <span>
              主页
          </span>
        </el-menu-item>
      </RouterLink>

        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>用户管理</span>
          </template>
          <el-menu-item-group>
            <RouterLink to="/administrator/usermain">
            <el-menu-item index="1-1">
                用户管理
            </el-menu-item>
          </RouterLink>
            <RouterLink to="/administrator/cardmain" >
            <el-menu-item index="1-2">
                球星卡管理
            </el-menu-item>
          </RouterLink>
          </el-menu-item-group>
        </el-sub-menu>

        <RouterLink to ="/administrator/fieldmain">
        <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>
              场地管理
          </span>
        </el-menu-item>
      </RouterLink>

        <RouterLink to="/administrator/bookmain">
        <el-menu-item index="3">
          <el-icon><icon-menu /></el-icon>
          <span>
              预约信息管理
          </span>
        </el-menu-item>
      </RouterLink>

      <RouterLink to="/administrator/newsmain">
        <el-menu-item index="4">
          <el-icon><icon-menu /></el-icon>
          <span>
              新闻信息管理
          </span>
        </el-menu-item>
      </RouterLink>

      <RouterLink to="/administrator/postmain">
        <el-menu-item index="5">
          <el-icon><icon-menu /></el-icon>
          <span>
              帖子信息管理
          </span>
        </el-menu-item>
      </RouterLink>

      <RouterLink to="/administrator/teammain">
        <el-menu-item index="6">
          <el-icon><icon-menu /></el-icon>
          <span>
              主队管理
          </span>
        </el-menu-item>
      </RouterLink>


      <RouterLink to="/administrator/teamgamemain">
        <el-menu-item index="7">
          <el-icon><icon-menu /></el-icon>
          <span>
              队伍比赛管理
          </span>
        </el-menu-item>
      </RouterLink>

      <RouterLink to="/administrator/teampersonmain">
        <el-menu-item index="8">
          <el-icon><icon-menu /></el-icon>
          <span>
              队伍球员管理
          </span>
        </el-menu-item>
      </RouterLink>

      
        <RouterLink to="/administrator/setup">
        <el-menu-item index="9">
          <el-icon><setting /></el-icon>
          <span>
              设置
          </span>
        </el-menu-item>
        </RouterLink>

      </el-menu>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import { RouterView } from 'vue-router';
import { Location, Setting } from '@element-plus/icons-vue';
import { RouterLink } from 'vue-router';



const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>

<style scoped>


a {
  text-decoration: none;
}
 
.router-link-active {
  text-decoration: none;
}



.el-menu-vertical-demo.custom-menu .el-menu-item.is-active {
  background-color: #87CEEB;
  color: white;
}

.el-menu-vertical-demo.custom-menu .el-sub-menu__title.is-active {
  background-color: #87CEEB;
  color: white;
}

.el-menu-vertical-demo.custom-menu .el-menu-item:hover,
.el-menu-vertical-demo.custom-menu .el-sub-menu__title:hover {
  background-color: #87CEEB;
}
</style>